1. Field of the Invention
The present invention relates to an image encoding apparatus, image encoding method and program, an image decoding apparatus, image decoding method and program, particularly, to entropy encoding/decoding in slice division.
2. Description of the Related Art
H.264/MPEG-4 AVC (hereafter, referred to as H.264) has been known as a coding method that is used to compress and record moving images. In H.264 (ITU-TH.264 (03/2010) Advanced video coding for generic audiovisual services), it is possible to divide an image into a plurality of slices and then encode the image. Dependency on data is small among the slices and encoding/decoding can be performed in parallel. One of the large advantages of slice division is to reduce the processing time by performing processes in parallel using a multi-core CPU.
The slices are encoded by the conventional binary arithmetic encoding which is adopted in the H.264. In other words, syntax elements such as mb_type and mb_qp_delta are binarized and binary signals are generated. The syntax elements are each provided with event probability in a table (hereafter, referred to as an event probability table) in advance and the binary signals are arithmetically encoded based on the event probability tables. Further, the event probability tables are updated for each encoding based on statistical information about whether the encoded binary signals are symbols with a high event probability.
Recently, a work for international standardization of a coding method that is more effective than the H.264 has been started and Joint Collaborative Team on Video Coding (JCT-VC) has been established between ISO/IEC and ITU-T. Standardization of the encoding method using High Efficiency Video Coding (hereafter, referred to as an HEVC) is in progress in the JCT-VC.
In standardization of HEVC, various coding methods are extensively examined to not only improve the encoding efficiency, but make mounting easy and reduce the processing time. A method for improving parallelism is also examined to reduce the processing time. In those methods, there is a method called Wavefront in which entropy encoding/decoding are performed in parallel (JCT-VC contribution JCTVC-F274.doc, internet address, <http://phenix.int-evry.fr/jct/doc_end_user/documents/6_Tor ino/wg11/>).
Since it is necessary to encode the binary signal of an encoding target using an event probability table that keeps updated, the processing cannot be performed unless resetting statistical information. However, resetting the statistical information deteriorates the encoding efficiency. On the other hand, the Wavefront applies the table of event probability when a plurality of blocks at positions designated in advance are encoded, to the block at the left end of the next line of the line to be processed. Accordingly, deterioration of the encoding efficiency is suppressed and blocks can be encoded in units of line in parallel. Although encoding in the Wavefront was described, decoding is performed in the same way.
However, even though it is possible to improve parallelism in units of line in the arithmetic encoding/decoding in the Wavefront, it is necessary to use the information of the encoded block at the position designated in advance, when encoding the block at the left end of the next line. Therefore, the block at the position designated in advance is necessary in the top line in a slice, such that the shapes of respective the slices are limited, when the slices and the Wavefront are combined.